import { _decorator, Component, Node } from 'cc';
import EventManager from '../../Init/Managers/EventManager';
import { EventTypes } from '../../Init/Managers/EventTypes';
import { Label } from 'cc';
import { GlobalTmpData } from '../../Init/Config/GlobalTmpData';

const { ccclass, property } = _decorator;

@ccclass('PropBtnCmp')
export class PropBtnCmp extends Component {

    protected onLoad(): void {

    }

    protected onEnable(): void {
        this.initBtns();
        this.initAnim();
    }

    protected onDisable(): void {
        this.resetBtns();
    }

    protected update(dt: number): void {
        this.updateBtns(dt);
    }

    //#region ---- 事件

    //#endregion

    //#region -----功能按钮

    initBtns() {

        // this.hideBtnAnim(this.removeBtn);
        // this.hideBtnAnim(this.changeBtn);
        // this.hideBtnAnim(this.avgSpdBtn);

        this.refreshBtnInfo();
    }
    resetBtns() {

    }
    refreshBtnInfo() {

    }

    updateBtns(dt) {

    }


    resetTouchTip() {
        // this.hideBtnAnim(this.avgSpdBtn);
        // this.hideBtnAnim(this.removeBtn);
        // this.hideBtnAnim(this.changeBtn);
    }

    reportPropLog() {
        GlobalTmpData.LvLogoData.tipCount++;
    }
    //#endregion

    //#region --- 按钮提示动画
    @property(Node)
    fingerAnim: Node = null;

    initAnim() {
        this.fingerAnim.active = false;
    }

    hideBtnAnim(btn: Node) {

        this.fingerAnim.active = false;
    }

    showBtnAnim(btn: Node) {

        this.fingerAnim.active = true;

        this.fingerAnim.setPosition(btn.position.x, btn.position.y + 70, 0);
    }

    //#endregion


}


